import {
  isArray
} from "@/utils/validate";

function checkArray(rule, value, callback) {
  if (!isArray(value)) {
    callback(new Error("Please add a data"));
  } else {
    callback();
  }
}
export const rules = {
  name: [{
    required: true,
    message: "please input name",
    trigger: "blur"
  }],
  procureditem: [{
    required: true,
    validator: checkArray
  }]
};

export function Model(name = "", remark = "", clist = [], procureditem = []) {
  this.name = name;
  this.remark = remark;
  this.clist = clist;
  this.procureditem = procureditem
}